package com.rmi.spring.server;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

import com.rmi.registry.zk.ZooKeeperServiceDiscovery;
import com.rmi.registry.zk.ZooKeeperServiceRegistry;

public class ZKServiceRegistry {

	@Value("${zk.address}")
	private String zkAddress;
	@Bean
	public ZooKeeperServiceRegistry zooKeeperServiceRegistry() {
		return new ZooKeeperServiceRegistry(zkAddress);
	}
	
	@Bean
	public ZooKeeperServiceDiscovery zooKeeperServiceDiscovery() {
		return new ZooKeeperServiceDiscovery(zkAddress);
	}
}
